#!/usr/bin/env python3

#  Copyright © 2015 SpaghettiToastBook
#
#  This file is part of Dimension BX2.1.
#
#  Dimension BX2.1 is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  Dimension BX2.1 is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with Dimension BX2.1. If not, see <http://www.gnu.org/licenses/>.

from cocos.director import director
from controls import *
from game import *

def main():

    class SceneControl:

        def __init__(self, initial_scene):
            controls.push_handlers(self)
            director.run(initial_scene)

        def on_restart_press(self):
            if isinstance(director.scene, GameScene) and counter.count == 0:
                director.replace(GameScene())

    scene_controller = SceneControl(GameScene())


if __name__ == '__main__':
    main()
